﻿var top_frame="130,*";
var strColumns_Current = "50,*";
function showfull() {
	if ((top.all.cols!="0,*") || (top.main.rows != "0,*")){
		strColumns_Current1 = top.main.rows;
		top_frame1=top.all.cols;
		top.all.cols="0,*";
		top.main.rows = "0,*";
	}else{
		top.all.cols=top_frame;
		top.main.rows = strColumns_Current;
	}
}
function showtop() {
	if (top.main.rows != "0,*"){
		strColumns_Current = top.main.rows;
		top.all.cols=top_frame;
		top.main.rows = "0,*";
	}else{
		top.all.cols=top_frame;
		top.main.rows = strColumns_Current;
	}
}
/*
function showleft() {
	if (top.all.cols !="0,*"){
		top_frame = top.all.cols;
		top.all.cols="0,*";
		top.main.rows = strColumns_Current;
	}else{
		top.all.cols=top_frame;
		top.main.rows = strColumns_Current;
	}
}
*/
function showleft() {
	divColl = document.all.tags("DIV");
	if (top.all.cols !="0,*"){
		top_frame = top.all.cols;
		top.all.cols="0,*";
		top.main.rows = strColumns_Current;
		for (i=1; i<divColl.length; i++){
            whichEl = divColl(i);
			if (whichEl.id == "div2" || whichEl.id == "DIV2")
				if (screen.height=="600")
				{
					whichEl.style.width = 790;
					div1.style.width=774;
				}else{
					whichEl.style.width = 1014;
					div1.style.width=998;
				}
		}
	}else{
		top.all.cols=top_frame;
		top.main.rows = strColumns_Current;
		for (i=1; i<divColl.length; i++){
            whichEl = divColl(i);
            if (whichEl.id == "div2" || whichEl.id == "DIV2") 
				if (screen.height=="600")
				{
					whichEl.style.width = 660;
					div1.style.width=644;
				}else{
					whichEl.style.width = 884;
					div1.style.width=868;
				}
		}
	}
}
function mout(thethis){
	if (thethis.style.backgroundColor!="red"){
		thethis.style.backgroundColor="";
	}
function mclick(thethis){
	for (i=0;i<document.links.length;i++)
	{
		document.links[i].style.backgroundColor=""
		document.links[i].style.color="";
		//alert(i)
	}
	thethis.style.backgroundColor="#000000";
	thethis.style.color="#FFFFFF";
}
}
function movermain(thethis){
	thethis.style.backgroundColor="#FBE8C0";
}
function radiotrue(names){
	obj=eval("document.forms[0]."+ names);
	obj.checked=true;
}
function checktrue(names){
	obj=eval("document.forms[0]." + names);
	if (obj.checked==true){
		obj.checked=false;
	}else{
		obj.checked=true;
	}
}

function set_contentleft_height(heightvalue,widthvalue){
	if (screen.height!="600"){
		div2.style.height=heightvalue;
		div1.style.width=widthvalue-16;
		div2.style.width=widthvalue;
	}
}

function set_contentleft_height1(heightvalue){
	if (screen.height!="600"){
		div2.style.height=heightvalue;
	}
}


function showstatus(status){
	window.status=status;
	return true;
}

//tree
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
ver4 = (NS4 || IE4) ? 1 : 0;
function initIt(formname){
	with (formname){
		if (!ver4) return;
		divColl = document.all.tags("DIV");
		if (IE4){
			for (i=0; i<divColl.length; i++) {
				whichEl = divColl(i);
				if (whichEl.className.indexOf("child") != -1 ) 
					whichEl.style.display = "none";
			}
		}
	}
}

function expandIt(el,formname) {
	with (formname){
		//alert(formname);
		el_len=el.length-3;
		tempstr=el.substr(0,el_len);
		//alert(el +"--"+ tempstr)
		whichEl = eval(el + "Child");
		imagesrc = eval(el + "wj");
		//alert(el + "wj");
		
		if (!ver4) return;
		if (IE4) {
			if (whichEl.style.display != "none") {
				whichEl.style.display = "none";
				imagesrc.src="../images/chinese/TreeAdd.gif"
			}
			else {
				divColl = document.all.tags("DIV");
				for (i=0; i<divColl.length; i++) {
					whichEl1 = divColl(i);
					if ((whichEl1.id.substr(0,el.length-2) == el.substr(0,el.length-2)) && (whichEl1.className.length == whichEl.className.length )) {
						whichEl1.style.display = "none";
					}
				}
				for (j=0;j<document.images.length;j++){
					if ((document.images[j].name.length == el.length + 2) && (document.images[j].name.indexOf(tempstr) != -1)){
						document.images[j].src="../images/chinese/TreeAdd.gif"
					}
				}
				whichEl.style.display = "block";
				imagesrc.src="../images/chinese/TreeSub.gif"
			}
		}
		
	}
}


function expandIt1(el,formname) {
	with (formname){
		//alert(formname);
		el_len=el.length-3;
		tempstr=el.substr(0,el_len);
		//alert(el +"--"+ tempstr)
		whichEl = eval(el + "Child");
		imagesrc = eval(el + "wj");
		//alert(el + "wj");
		
		if (!ver4) return;
		if (IE4) {
			if (whichEl.style.display != "none") {
				whichEl.style.display = "none";
				imagesrc.src="../images/chinese/TreeAdd.gif"
			}
			else {
				/*
				divColl = document.all.tags("DIV");
				for (i=0; i<divColl.length; i++) {
					whichEl1 = divColl(i);
					if ((whichEl1.id.substr(0,el.length-2) == el.substr(0,el.length-2)) && (whichEl1.className.length == whichEl.className.length )) {
						whichEl1.style.display = "none";
					}
				}
				for (j=0;j<document.images.length;j++){
					if ((document.images[j].name.length == el.length + 2) && (document.images[j].name.indexOf(tempstr) != -1)){
						document.images[j].src="../images/chinese/TreeAdd.gif"
					}
				}
				*/
				whichEl.style.display = "block";
				imagesrc.src="../images/chinese/TreeSub.gif"
			}
		}
		
	}
}

function expandIt2(el,formname) {
	with (formname){
		//alert(formname);
		el_len=el.length-3;
		tempstr=el.substr(0,el_len);
		//alert(el +"--"+ tempstr)
		whichEl = eval(el + "Child");
		imagesrc = eval(el + "wj");
		//alert(el + "wj");
		
		if (!ver4) return;
		if (IE4) {
			if (whichEl.style.display != "none") {
				whichEl.style.display = "none";
				imagesrc.src="../images/chinese/TreeAdd.gif"
			}
			else {
				/*
				divColl = document.all.tags("DIV");
				for (i=0; i<divColl.length; i++) {
					whichEl1 = divColl(i);
					if ((whichEl1.id.substr(0,el.length-2) == el.substr(0,el.length-2)) && (whichEl1.className.length == whichEl.className.length )) {
						whichEl1.style.display = "none";
					}
				}
				for (j=0;j<document.images.length;j++){
					if ((document.images[j].name.length == el.length + 2) && (document.images[j].name.indexOf(tempstr) != -1)){
						document.images[j].src="../images/chinese/TreeAdd.gif"
					}
				}
				*/
				whichEl.style.display = "block";
				imagesrc.src="../images/chinese/TreeSub.gif"
			}
		}
		
	}
}

function openall(formname){
	//alert("open");
	with (formname){
		divColl = document.all.tags("DIV");
		for (i=1; i<divColl.length; i++) {
			whichEl = divColl(i);
			if (whichEl.className.indexOf("child") != -1 ) 
				whichEl.style.display = "block";
		}
		for (j=0;j<document.images.length;j++){
			if (document.images[j].name.indexOf("KB") != -1){
				document.images[j].src="../images/chinese/TreeSub.gif"
			}
		}
	}
}

function closeall(formname){
	//alert("close");
	with (formname){
		if (!ver4) return;
		if (IE4){
			divColl = document.all.tags("DIV");
			for (i=1; i<divColl.length; i++) {
				whichEl = divColl(i);
				if (whichEl.className.indexOf("child") != -1 ) 
					whichEl.style.display = "none";
			}
			for (j=0;j<document.images.length;j++){
				if (document.images[j].name.indexOf("KB") != -1){
					document.images[j].src="../images/chinese/TreeAdd.gif"
				}
			}
		}
	}
}
//tree-end

function menust(imgname){
	for (i=0;i<document.images.length;i++ )	{
		if (document.images[i].name.length>0)
		{
			document.images[i].src="../images/chinese/"+ document.images[i].name +"1.gif"
		}
	}
	obj=eval("document."+imgname)
	obj.src="../images/chinese/"+ imgname +".gif"
}
function menust1(imgname){
	for (i=0;i<document.images.length;i++ )	{
		if (document.images[i].name.length>0)
		{
			document.images[i].src="../images/chinese/"+ document.images[i].name +"1.gif"
		}
	}
	obj=eval("document."+imgname)
	obj.src="../images/chinese/"+ imgname +".gif"
}
function menust2(imgname){
	for (i=0;i<document.images.length;i++ )	{
		if (document.images[i].name.length>0)
		{
			document.images[i].src="../../images/chinese/"+ document.images[i].name +"1.gif"
		}
	}
	obj=eval("document."+imgname)
	obj.src="../../images/chinese/"+ imgname +".gif"
}
function isCharsInBag (s, bag){  
  var i;
  for (i = 0; i < s.length; i++){   
      var c = s.charAt(i);
      if (bag.indexOf(c) == -1) return false;
  }
  return true;
}
function add(objname){
	obj=eval("document.forms[0]."+objname)
	if (isCharsInBag(obj.value,"0123456789")){
		temp=Math.round(obj.value)
		obj.value=temp+1
	}else{
		alert("请填写整数!")
		obj.focus()
	}	
}
function reduce(objname){
	obj=eval("document.forms[0]."+objname)
	if (isCharsInBag(obj.value,"0123456789")){
		temp=Math.round(obj.value)
		if (temp>0){
			obj.value=temp-1
		}
	}else{
		alert("请填写整数!")
		obj.focus()
	}
}

function mclick(obj){
	if (document.form1.modify1!=null){
		for (i=0;i<document.form1.modify1.length;i++){
			document.form1.modify1[i].className="grayinput-number"
			//alert(document.form1.modify[i].className)
		}
	}	
	if (document.form1.modif1!=null){
		if (document.form1.modif1.length>1){
			for (j=0;j<document.form1.modif1.length;j++){
				document.form1.modif1[j].className="grayinput"
				//alert(document.form1.modif1[j].className)
			}
		}else{
			document.form1.modif1.className="grayinput"
		}
	}
	if (document.form1.modify2!=null){
		for (i=0;i<document.form1.modify2.length;i++){
			document.form1.modify2[i].className="whiteinput-number"
			//alert(document.form1.modify[i].className)
		}
	}
	if (document.form1.modif2!=null){
		if (document.form1.modif2.length>1){
			for (j=0;j<document.form1.modif2.length;j++){
				document.form1.modif2[j].className="whiteinput"
				//alert(document.form1.modif2[j].className)
			}
		}else{
			document.form1.modif2.className="whiteinput"
		}
	}
	obj.className="none"
}
function dclick(){
	if (document.form1.modify1!=null){
		for (i=0;i<document.form1.modify1.length;i++){
			document.form1.modify1[i].className="grayinput-number"
			//alert(document.form1.modify[i].className)
		}
	}	
	if (document.form1.modif1!=null){
		if (document.form1.modif1.length>1){
			for (j=0;j<document.form1.modif1.length;j++){
				document.form1.modif1[j].className="grayinput"
				//alert(document.form1.modif1[j].className)
			}
		}else{
			document.form1.modif1.className="grayinput"
		}
	}
	if (document.form1.modify2!=null){
		for (i=0;i<document.form1.modify2.length;i++){
			document.form1.modify2[i].className="whiteinput-number"
			//alert(document.form1.modify[i].className)
		}
	}
	if (document.form1.modif2!=null){
		if (document.form1.modif2.length>1){
			for (j=0;j<document.form1.modif2.length;j++){
				document.form1.modif2[j].className="whiteinput"
				//alert(document.form1.modif2[j].className)
			}
		}else{
			document.form1.modif2.className="whiteinput"
		}
	}
	//obj.className="none"
}

function gotourl(url){
	top.location.href=url
}
function Surl(urls)
{
window.location.href=urls
}
function ParentSurl(urls)
{
parent.location.href=urls
}
function betlink(sClass, vValue)
{
	ccs=form1.trname.value;
	trs=form1.sclassnamea.value;
	ccs1=eval(ccs);
	ccs1.className=trs;
	document.form1.sclassnamea.value = sClass;
	document.form1.trname.value = vValue;
}
function page_actiondown(action)
{
    parent.down.location.href = action;
}

function page_actionRight(action)
{
    parent.rightFrame.location.href = action;
}
var now = new Date();
	var year = now.getYear();
	var month = now.getMonth() + 1;
	var date = now.getDate();

var dateValue = "";
	dateValue += year + "-";
	dateValue += ((month < 10) ? "0" : "") + month + "-";
	dateValue += date;
	
var timerID = null
var timerRunning = false
function MakeArray(size) {
	this.length = size;
	for(var i = 1; i <= size; i++)
		{
			this[i] = "";
		}
	return this;
}

var now = new Date();
	var year = now.getYear();
	var month = now.getMonth() + 1;
	var date = now.getDate();
var day = now.getDay();
	Day = new MakeArray(7);
	Day[0]="星期天";
	Day[1]="星期一";
	Day[2]="星期二";
	Day[3]="星期三";
	Day[4]="星期四";
	Day[5]="星期五";
	Day[6]="星期六";
var dateValue = "";
	dateValue += year + "-";
	dateValue += ((month < 10) ? "0" : "") + month + "-";
	dateValue += date + "  ";
	//dateValue += (Day[day]) + "  ";

function stopclock (){
	if(timerRunning)
		clearTimeout(timerID);
	timerRunning = false
}
function showtime () {
	var now = new Date();
	var hours = now.getHours();
	var minutes = now.getMinutes();
	var seconds = now.getSeconds();
	//var timeValue = hours+8;
	var timeValue = hours
	if (timeValue>=24){
		timeValue=timeValue-24;
	}
	//timeValue += ((hours <= 12) ? hours : hours - 12);
	//timeValue += ;
	timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
	timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
	//timeValue += (hours < 12) ? "上午" : "下午";
	document.all.face.value = timeValue;
	timerID = setTimeout("showtime()",1000);
	timerRunning = true
}
function startclock () {
	stopclock();
	showtime();
}             	
	
	
	
function PopOpen(filename,ISheight,ISwidth,openname)
{
  if (openname='')
  {
  openname='newwindow'  
  }
   window.open(filename, openname, "height="+ISheight+", width="+ISwidth+",top=100,left=100,toolbar=n0, menubar=no, scrollbars=yes, resizable=no, location=no, status=no")
}

function Topurls(urla,urlb)
{
top.left.location.href=urla
parent.content.location.href=urlb
}
